var str1 = 'getLineReverse'
var str2 = 'get_line'

function toLine (str) {
  return str.replace(/([A-Z])/g, "_$1").toLowerCase()
}

function toHump (str) {
  return str.replace(/\_(\w)/g, function (all, letter) {
    return letter.toUpperCase()
  })
}

console.log(toLine(str1))
console.log(toHump(str2))
